package com.wanxi.controller;

import com.wanxi.entity.Result;
import com.wanxi.vo.BrandVo;
import com.wanxi.vo.PageVo;
import com.wanxi.vo.SpecificationVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @author yangjin
 * @date 2022年08月11日 11:02
 */

@RestController
@RequestMapping("/web/specification")
@Api(tags = "商品规格管理")
public class SpecificationController {

    @GetMapping("/specificList")
    @ApiOperation("商品规格列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "specsId",value = "规格Id",dataType = "Integer"),
    })
    public Result specificList(Integer specsId, SpecificationVo specificationVo, PageVo pageVo){

        return new Result("",0,new SpecificationVo(),10,null);
    }

    @PostMapping("/addSpecific")
    @ApiOperation("商品规格添加")
    public Result addSpecific(@RequestBody List<SpecificationVo> specificationVo){
        return new Result("add successful",200,null,0,null);
    }

    @PostMapping("/specificUpdate")
    @ApiOperation("商品规格编辑")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "specsId",value = "规格Id",required = true,dataType = "Integer"),
    })
    public Result cateUpdate(@RequestParam Integer specsId,@RequestBody BrandVo brandVo){

        return new Result("update successful",200,null,1,null);
    }

    @PostMapping("/specificDelete")
    @ApiOperation("商品规格删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "specsId",value = "规格Id",required = true,dataType = "Integer"),

    })
    public Result cateDelete(@RequestParam Integer specsId){

        return new Result("delete successful",200,null,1,null);
    }

    @GetMapping("/specificFindById")
    @ApiOperation("按Id查询单条规格")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "specsId",value = "规格Id",required = true,dataType = "Integer"),
    })
    public Result brandFindById(@RequestParam Integer specsId){
        return new Result("",0,new SpecificationVo(),1,null);
    }
}
